﻿using Abp.Application.Navigation;
using Abp.Localization;
using Akso.Authorization;
using Akso.Web.Navigation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Akso.Web.Areas.BasicDataModule.Startup
{
    public class BasicDataModuleNavigationProvider : NavigationProvider
    {
        public const string MenuName = "BasicDataModule";
        public override void SetNavigation(INavigationProviderContext context)
        {
            var menu = context.Manager.Menus[MenuName] = new MenuDefinition(MenuName, new FixedLocalizableString("BasicDataModule Menu"));

            menu
                .AddItem(new MenuItemDefinition(
                    PageNames.App.Business.BasicDataModule,
                    L("Pages_BasicDataModule"),
                    icon: "icon-wrench"
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.Business.Classrooms,
                        L("Pages_BasicDataModule_Classrooms"),
                        url: "BasicDataModule/Classrooms",
                        icon: "icon-layers",
                        requiredPermissionName: AppPermissions.Pages_BasicDataModule_Classrooms
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.Business.CodeSettings,
                        L("Pages_BasicDataModule_CodeSettings"),
                        url: "BasicDataModule/CodeGroups",
                        icon: "icon-layers",
                        requiredPermissionName: AppPermissions.Pages_BasicDataModule_CodeSettings
                        )
                    )
                );
        }

        private static ILocalizableString L(string name)
        {
            return new LocalizableString(name, AbpZeroTemplateConsts.LocalizationSourceName);
        }
    }
}